var httpSvc = require("./httpSvc");
var cf = require("../utils/config");
var q = require("querystring");
/*
* 请求规范
* @param d  json     请求数据
* @param h  json     请求头
* @param cb function callback函数
*
* */

//获取自媒体主页轮播图列表
exports.getMainCarouselList = function(d,h,cb){
    var path =cf.path_mediaAdv+"/getMainCarouselList";
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("自媒体主页轮播图：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("自媒体主页轮播图：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//获取头条新闻信息
exports.getHotNewsList = function(d,h,cb){
    var path =cf.path_mediaAdv+"/getHotNewsList";
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("获取头条新闻信息：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("获取头条新闻信息：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//通过当前登录用户id获取分类信息
exports.getUserCategoryList = function(d,h,cb){
    var path =cf.path_mediaAdv+"/getUserCategoryList?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("自媒体主页分类：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("自媒体主页分类：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//获取自媒体主页top10列表
exports.getMainTop10List = function(d,h,cb){
    var path =cf.path_mediaAdv+"/getMainTop10List";
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("获取自媒体主页top10列表：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("获取自媒体主页top10列表：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//获取自媒体人气分页信息
exports.getMainHotAdvList = function(d,h,cb){
    var path =cf.path_mediaAdv+"/getMainHotAdvList?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("获取自媒体人气分页信息：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("获取自媒体人气分页信息：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//获取所有自媒体分类信息
exports.getMainAllCategoryList = function(d,h,cb){
    var path =cf.path_mediaAdv+"/getMainAllCategoryList";
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("获取所有自媒体分类信息：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("获取所有自媒体分类信息：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//获取主页圈子列表
exports.getCirclesList = function(d,h,cb){
    var path =cf.path_mediaAdv+"/getCirclesList";
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("获取主页圈子列表：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("获取主页圈子列表：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//获取自媒体主页附近分页信息
exports.getMainNearbyAdvList = function(d,h,cb){
    var path =cf.path_mediaAdv+"/getMainNearbyAdvList?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("自媒体主页附近：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("自媒体主页附近：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//增加自媒体用户分类信息
exports.addUserCategory = function(d,h,cb){
    var path =cf.path_mediaAdv+"/addUserCategory?loginUid="+d.loginUid+"&"+d.categoryId;
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("增加自媒体用户分类信息：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("增加自媒体用户分类信息：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};

//获取自媒体top10列表
exports.getMediaTop10List = function(d,h,cb){
    var path =cf.path_mediaAdv+"/getMediaTop10List";
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("获取自媒体top10列表：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("获取自媒体top10列表：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//获取自媒体圈子列表
exports.getMediaCirclesList = function(d,h,cb){
    var path =cf.path_mediaAdv+"/getMediaCirclesList?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("获取自媒体圈子列表：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("获取自媒体圈子列表：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//获取自媒体人气分页信息
exports.getMediaHotAdvList = function(d,h,cb){
    var path =cf.path_mediaAdv+"/getMediaHotAdvList?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("获取自媒体人气分页信息：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("获取自媒体人气分页信息：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//增加自媒体附近分页信息
exports.getMediaNearbyAdvList = function(d,h,cb){
    var path =cf.path_mediaAdv+"/getMediaNearbyAdvList?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("增加自媒体附近分页信息：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("增加自媒体附近分页信息：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};

//自媒体分类轮播
exports.getCategoryCarouselList = function(d,h,cb){
    var path =cf.path_mediaAdv+"/getCategoryCarouselList?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("自媒体分类轮播：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("自媒体分类轮播：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//获取自媒体分类top10列表
exports.getCategoryTop10List = function(d,h,cb){
    var path =cf.path_mediaAdv+"/getCategoryTop10List?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("自媒体分类top10列表：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("自媒体分类top10列表：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//获取自媒体分类人气分页信息
exports.getCategoryHotAdvList = function(d,h,cb){
    var path =cf.path_mediaAdv+"/getCategoryHotAdvList?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("获取自媒体分类人气分页信息：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("获取自媒体分类人气分页信息：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//获取自媒体分类页附近分页信息
exports.getCategoryNearbyAdvList = function(d,h,cb){
    var path =cf.path_mediaAdv+"/getCategoryNearbyAdvList?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("获取自媒体分类附近分页信息：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("获取自媒体分类附近分页信息：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//获取分类页圈子列表
exports.getCategoryCirclesList = function(d,h,cb){
    var path =cf.path_mediaAdv+"/getCategoryCirclesList?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("获取分类页圈子列表：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("获取分类页圈子列表：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//获取中国省市区列表
exports.getChinaList = function(d,h,cb){
    var path =cf.path_adv+"/getChinaList?version="+d.version;
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("获取中国省市区列表：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("获取中国省市区列表：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//获取海外国家 ,州市列表, 州和市
exports.getCountryStateList = function(d,h,cb){
    var path =cf.path_adv+"/getCountryStateList?parentId="+d.parentId;
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("获取海外国家 ,州市列表, 州和市：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("获取海外国家 ,州市列表, 州和市：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//自媒体-获取企业广告视频信息
exports.getMediaAdvAdvById = function(d,h,cb){
    var path =cf.path_mediaAdv+"/getMediaAdvAdvById?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("自媒体-获取企业广告视频信息：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("自媒体-获取企业广告视频信息：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//通过用户id 视频id state点赞状态 1点赞0取消点赞
exports.getPraise = function(d,h,cb){
    var path =cf.path_mediaAdv+"/praise?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("自媒体-点赞状态：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("自媒体-点赞状态：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//通过用户id 视频id state收藏状态 1收藏0取消收藏
exports.getCollection = function(d,h,cb){
    var path =cf.path_mediaAdv+"/collection?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("自媒体-收藏状态：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("自媒体-收藏状态：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//获取自媒体评论列表
exports.getInfoMediaAdvCommentList = function(d,h,cb){
    var path =cf.path_adv+"/getInfoMediaAdvCommentList?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("获取自媒体评论列表：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("获取自媒体评论列表：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//自媒体-打开红包
exports.getRedPacketsMediaAdvById = function(d,h,cb){
    var path =cf.path_mediaAdv+"/getRedPacketsMediaAdvById?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("自媒体-打开红包：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("自媒体-打开红包：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//通过招聘id获取招聘信息
exports.getRecruitById = function(d,h,cb){
    var path =cf.path_mediaAdv+"/getRecruitById?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("通过招聘id获取招聘信息：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("通过招聘id获取招聘信息：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//自媒体打赏
exports.mediaReward = function(d,h,cb){
    var path =cf.path_adv+"/reward?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("自媒体打赏：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("自媒体打赏：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//自媒体-发表评论
exports.comment = function(d,h,cb){
    var path =cf.path_adv+"/comment?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("自媒体-发表评论：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("自媒体-发表评论：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//自媒体评论点赞
exports.praiseMediaAdvComment = function(d,h,cb){
    var path =cf.path_adv+"/praiseMediaAdvComment?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("自媒体评论点赞：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("自媒体评论点赞：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//自媒体-获取评论回复列表
exports.getInfoMediaAdvCommentReplyList = function(d,h,cb){
    var path =cf.path_adv+"/getInfoMediaAdvCommentReplyList?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("自媒体-获取评论回复列表：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("自媒体-获取评论回复列表：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//自媒体-评论回复-详情
exports.getAdvCommentsByCommentId = function(d,h,cb){
    var path =cf.path_adv+"/getAdvCommentsByCommentId?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("自媒体-评论回复-详情：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("自媒体-评论回复-详情：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//城市广告主页信息
exports.getMain = function(d,h,cb){
    var path =cf.path_cityAdv+"/getMain";
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("城市广告主页信息：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("城市广告主页信息：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//城市广告人气信息
exports.getCityAdvList = function(d,h,cb){
    var path =cf.path_cityAdv+"/getCityAdvList?pageNumber="+d.pageNumber;
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("城市广告人气信息：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("城市广告人气信息：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//城市广告附近信息
exports.getCityNearbyAdvList = function(d,h,cb){
    var path =cf.path_cityAdv+"/getCityNearbyAdvList?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("城市广告附近信息：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("城市广告附近信息：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//获取城市广告热门城市列表
exports.getAllHots = function(d,h,cb){
    var path =cf.path_cityAdv+"/getAllHots?pageNumber="+d.pageNumber;
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("获取城市广告热门城市列表：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("获取城市广告热门城市列表：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//获取城市广告详细信息
exports.getCityInfoById = function(d,h,cb){
    var path =cf.path_cityAdv+"/getCityInfoById?cityId="+d.cityId;
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("获取城市广告详细信息：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("获取城市广告详细信息：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//获取城市广告分类列表
exports.getCategoryCityAdvList = function(d,h,cb){
    var path =cf.path_cityAdv+"/getCategoryCityAdvList?"+q.stringify(d);
    if(d.categoryId){
        path+="&categoryId="+d.categoryId;
    }
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("获取城市广告分类列表：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("获取城市广告分类列表：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//获取城市游记详情
exports.getCityAdvInfo = function(d,h,cb){
    var path =cf.path_cityAdv+"/getCityAdvInfo?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("获取城市游记详情：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("获取城市游记详情：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//获取城市视频详情
exports.getCityAdvMediaInfo = function(d,h,cb){
    var path =cf.path_cityAdv+"/getCityAdvMediaInfo?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("获取城市视频详情：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("获取城市视频详情：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//通过用户id 视频id state点赞状态 1点赞0取消点赞
exports.getCityAdPraise = function(d,h,cb){
    var path =cf.path_cityAdv+"/praise?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("城市广告-点赞状态：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("城市广告-点赞状态：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//通过用户id 视频id state收藏状态 1收藏0取消收藏
exports.getCityAdCollection = function(d,h,cb){
    var path =cf.path_cityAdv+"/collection?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("城市广告-收藏状态：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("城市广告-收藏状态：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//获取城市广告评论列表
exports.getCityAdCommentList = function(d,h,cb){
    var path =cf.path_cityAdv+"/getInfoMediaAdvCommentList?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("获取城市广告评论列表：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("获取城市广告评论列表：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//城市打赏
exports.cityAdReward = function(d,h,cb){
    var path =cf.path_cityAdv+"/reward?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("城市打赏：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("城市打赏：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//城市广告-游记购买展位
exports.buyBooth = function(d,h,cb){
    var path =cf.path_mediaAdv+"/buyBooth?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("城市广告-游记购买展位：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("城市广告-游记购买展位：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//筛选-自媒体分类页-查询配置
exports.getCategoryQuery = function(d,h,cb){
    var path =cf.path_mediaAdv+"/getCategoryQuery?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("筛选-配置：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("筛选-配置：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//筛选-结果
exports.getCategoryQueryList = function(d,h,cb){
    var path =cf.path_mediaAdv+"/getCategoryQueryList?"+q.stringify(d);
/*    if(d.categoryId){
        path+="&categoryId="+d.categoryId;
    }
    if(d.provinceId ){
        path+="&provinceId="+d.provinceId;
    }*/
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("筛选-结果：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("筛选-结果：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//获取自媒体筛选分页信息
exports.getCategorySearchAdvList = function(d,h,cb){
    var path =cf.path_mediaAdv+"/getCategorySearchAdvList?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("获取自媒体筛选分页信息：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("获取自媒体筛选分页信息：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//获取自媒体圈子筛选
exports.getMediaSearchCirclesList = function(d,h,cb){
    var path =cf.path_mediaAdv+"/getMediaSearchCirclesList?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("获取自媒体圈子筛选：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("获取自媒体圈子筛选：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//乐看搜索历史
exports.searchHistory = function(d,h,cb){
    var path =cf.path_mediaAdv+"/searchHistory?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("乐看搜索历史：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("乐看搜索历史：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//搜索自媒体-提示框
exports.searchMedia = function(d,h,cb){
    var path =cf.path_mediaAdv+"/searchMedia?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("搜索自媒体-提示框：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("搜索自媒体-提示框：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//清空自媒体搜索历史
exports.emptySearchHistory = function(d,h,cb){
    var path =cf.path_mediaAdv+"/emptySearchHistory?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("清空自媒体搜索历史：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("清空自媒体搜索历史：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};
//自媒体-搜索-列表
exports.searchMediaList = function(d,h,cb){
    var path =cf.path_mediaAdv+"/searchMediaList?"+q.stringify(d);
    var opt = httpSvc.makeOpt(cf.server_host,cf.server_port, path, "post");
    httpSvc.httpReq(opt, function (b) {
        if (b.json.code !=0) {
            global.logerror("自媒体-搜索-列表：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + (b.body ));
        } else {
            global.loginfo("自媒体-搜索-列表：" + JSON.stringify(opt) + " .posts. " + JSON.stringify(d) + " .back. " + b.body);
        }
        cb(b)
    }, d);
};